package com.twu.biblioteca.domain;

public class RepositoryFactory {
    public static Repository<Book> createDummyBookRepository() {
        Repository<Book> bookRepository = new Repository<Book>();

        Book book1 = new Book("1", "Effective Java", "Joshua Bloch");
        bookRepository.add(book1);

        Book book2 = new Book("2", "Clean Code", "Robert C. Martin");
        bookRepository.add(book2);

        Book book3 = new Book("3", "TDD By Example", "Kent Beck");
        bookRepository.add(book3);

        return bookRepository;
    }

    public static Repository<Movie> createDummyMovieRepository() {
        Repository<Movie> movieRepository = new Repository<Movie>();

        Movie movie = new Movie("M1", "Avatar", 2009, "James Cameron", Rating.Seven);
        movieRepository.add(movie);

        movie = new Movie("M2", "The Lord of the Rings: The Return of the King", 2003, "Peter Jackson", Rating.Eight);
        movieRepository.add(movie);

        movie = new Movie("M3", "Pirates of the Carribbean: Dead Man's Chest", 2006, "Gore Verbinski", Rating.Six);
        movieRepository.add(movie);

        movie = new Movie("M4", "The Dark Knight", 2008, "Christopher Nolan", Rating.Five);
        movieRepository.add(movie);

        movie = new Movie("M5", "Harry Potter and the Philosopher's Stone", 2001, "Chris Columbus", Rating.Six);
        movieRepository.add(movie);

        movie = new Movie("M6", "Pirates of the Caribbean: At World's End", 2007, "Gore Verbinski", Rating.Seven);
        movieRepository.add(movie);

        movie = new Movie("M7", "Harry Potter and the Order of the Phoenix", 2007, "David Yates", Rating.Four);
        movieRepository.add(movie);

        movie = new Movie("M8", "Harry Potter and the Half-Blood Prince", 2009, "David Yates", Rating.Five);
        movieRepository.add(movie);

        movie = new Movie("M9", "The Lord of the Rings: The Two Towers", 2002, "Peter Jackson", Rating.Eight);
        movieRepository.add(movie);

        movie = new Movie("M10", "Shrek 2", 2004, "Andrew Adamson", Rating.Four);
        movieRepository.add(movie);

        movie = new Movie("M11", "Harry Potter and the Goblet of Fire", 2005, "Mike Newell", Rating.Three);
        movieRepository.add(movie);

        movie = new Movie("M12", "Spider-Man 3", 2007, "Sam Raimi", Rating.Five);
        movieRepository.add(movie);

        movie = new Movie("M13", "Ice Age: Dawn of the Dinosaurs", 2009, "Carlos Saldanha", Rating.Two);
        movieRepository.add(movie);

        movie = new Movie("M14", "Harry Potter and the Chamber of Secrets", 2002, "Chris Columbus", Rating.One);
        movieRepository.add(movie);

        movie = new Movie("M15", "The Lord of the Rings The Fellowship of the Ring", 2001, "Peter Jackson", Rating.None);
        movieRepository.add(movie);

        return movieRepository;
    }
}
